﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PainelUsuario.master" AutoEventWireup="true" CodeFile="numero_contrato.aspx.cs" Inherits="numero_contrato" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <% (this.Master as PainelUsuario).ActiveMenu = 13; %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="TitleContent" Runat="Server">
    Gerador de Número de Contrato
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentContent" Runat="Server">
    <div class="widget">    
        <div class="head">
            <h5 class="iDoc">
                Contratos
            </h5>
        </div>   

        <div class="rowElem noborder">                
            <div class="formLeft">                             
                <center>
                    <div style="margin: width: 300px;">
                        <br />
                        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> 
                        <%
                            System.Threading.Thread.Sleep(1000);
                            DateTime date = DateTime.Now;
                            string month = "" + date.Month;
                            if (month.Length == 1)
                            {
                                month = "0" + month;
                            }
                            string day = "" + date.Day;
                            if (day.Length == 1)
                            {
                                day = "0" + day;
                            }
                            
                            string hour = "" + date.Hour;
                            if (hour.Length == 1)
                            {
                                hour = "0" + hour;
                            }
                            string minute = "" + date.Minute;
                            if (minute.Length == 1)
                            {
                                minute = "0" + minute;
                            }
                            string second = "" + date.Second;
                            if (second.Length == 1)
                            {
                                second = "0" + second;
                            }  
                                                                                                                                          
                            string number = ("" + date.Year + "" + month + day + hour + minute + second);
                            double dNumber = double.Parse(number);
                        %>
                        <strong></strong><%= dNumber.ToString("#,##0") %>
                        <br />                        
                        <input id="generateButton" type="button" value="Gerar outro número" onclick="generateButton.disabled = true; window.location = window.location;" />            
                        <br />
                    </div>
                </center>            
            </div>
        </div>
    </div> 
</asp:Content>

